package com.szt.ynb.server.router.controller.advise;

import javax.servlet.http.HttpSession;

import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ModelAttribute;

import com.szt.ynb.server.router.common.SessionConst;
import com.szt.ynb.server.router.pojo.SessionUser;

@ControllerAdvice
public class GlobalControllerAdvise {
	
	@ModelAttribute
	public SessionUser sessionUser(HttpSession httpSession) {
		return (SessionUser) httpSession.getAttribute(SessionConst.SESSION_ADMIN);
	}
	
}
